import time
import streamlit as st
import sys

from cfm.form import Form, FormSubmitButton

print(sys.argv)

st.set_page_config(
    page_title="Frontend",
    # page_icon="👋",
)

st.write("Hello world from front end!")

with st.form(key="form", clear_on_submit=True):
    Form._create()
    
    submitted = FormSubmitButton()._create()
    if submitted:
        Form._handle()
        
        st.success("Success!")
        time.sleep(1)
        st.rerun()